package com.example.hearthstoneagain;

import android.support.v4.app.Fragment;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TabHost;
import android.os.Build;

public class MainActivity extends TabActivity {

	Bundle savedinst;
	
	TabHost host;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.outrolayout);

		
		Log.i(this.toString(), "get tab host");
	      host = getTabHost();
	      host.setup();

	      Log.i(this.toString(), "add tabs");
	      host.addTab(host.newTabSpec("one")
	                      .setIndicator("Search")
	                      .setContent( 	new Intent(this, SearchTabGroupActivity.class)));

	      host.addTab(host.newTabSpec("two")
	                      .setIndicator("Deck")
	                      .setContent(new Intent(this, DeckTabGroupActivity.class)));
	      
	      host.addTab(host.newTabSpec("three")
                  .setIndicator("News")
                  .setContent(new Intent(this, NewsTabGroupActivity.class)));
	      
	      //host.addTab(host.newTabSpec("four")
          //        .setIndicator("Options")
          //        .setContent(new Intent(this, MainOptionsActivity.class)));

	      Log.i(this.toString(), "adjust tab size");
	      host.getTabWidget().getChildAt(0).getLayoutParams().height = 100;
	      host.getTabWidget().getChildAt(1).getLayoutParams().height = 100;
		
	}
	
	public void onResume() {
		Log.i(this.toString(), "resumindo");
		super.onResume();
	}

	public void switchTab(int tab) {
		host.setCurrentTab(tab);
	}
	
}
